#ifndef prs_FrmParaEditStyle_H
#define prs_FrmParaEditStyle_H

#include "prs_FrmFunc.h"
#include "prs_FrmRules.h"
#include "prs_FrmStyleState.h"
#include "frm_control_TParaEdit.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TNodeFrmParaEditStyle : public TNodeStyleControl
{
  DECLARE_ClientNode()
  TAttrNodeType<nodeType_ParaEdit> NodeType;
  TAttrObject<nodeType_Style,frm::control::TParaEdit::TStyle> Style;
  //
  TNodeFrmParaEditStyle() : NodeType(this),Style(this) {}
};

///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmParaEditStyle : public snt::TRule
{
  TRuleFrmParaEditStyle(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleFrmStyleState &RStyleState
  );
  
private:  
  TNodeFrmParaEditStyle *GetNode() { return dynamic_cast<TNodeFrmParaEditStyle*>(vParentNode.Pointer());}
  //
  void FNormal(snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Normal );}
  //
/************
  void FParaNormal  (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Para.Normal );}
  void FParaSelected(snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Para.Selected );}
  void FParaFocused (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Para.Focused );}
  //
  void FParaLineNormal  (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Para.Line.Normal );}
  void FParaLineSelected(snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Para.Line.Selected );}
  void FParaLineFocused (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Para.Line.Focused );}
*************/  
  //
  svl::TVariant &vParentNode;
  snt::TAlter A;
  TRuleFrmStyleState &rStyleState;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
